<?php

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

//Define path to task images
defined('IMG_PATH')
    || define('IMG_PATH', realpath(dirname(__FILE__) . '/task_images/'));


// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

// Set default time zone
date_default_timezone_set('Europe/Kiev');

// Process include path
$includePath = explode(PATH_SEPARATOR, get_include_path());
    
/**
 * Define environment specific values
 */
if ('politeh.localhost' == $_SERVER['SERVER_NAME']) {
	
	define('BASE_URL', 'http://politeh.localhost/');

	unset($includePath[0]);
	$includePath[] = realpath(APPLICATION_PATH . '/../library');

} elseif ('localhost' == $_SERVER['SERVER_NAME']) {  /* SET OLEKSIY SPECIFIC ENVIRONMENT SETTINGS */
	
	define('BASE_URL', 'http://localhost/course/public/');

	unset($includePath[0]);
	$includePath[] = realpath(APPLICATION_PATH . '/../library');
	
} else { /* Production server settings */

	define('BASE_URL', 'http://alexintro.ftpaccess.cc/course/public/');

	unset($includePath[0]);
	$includePath[] = realpath(APPLICATION_PATH . '/../library');
}

// clean up the include path and ensure all required values are set
set_include_path(implode(PATH_SEPARATOR, $includePath));



// Zend_Application
require_once 'Zend/Application.php';  

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV, 
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();
